package com.zhu.ttwords.presenter;

import com.zhu.ttwords.model.IStudyModel;
import com.zhu.ttwords.model.StudyModel;
import com.zhu.ttwords.view.activity.IStudyActivity;

import java.util.List;

/**
 * Created by KnightYe on 2015/4/3.
 */
public class StudyPresenter {

    IStudyActivity activity;
    IStudyModel model;
    int currentMode = 0;

    public StudyPresenter(IStudyActivity activity) {
        this.activity = activity;
        this.model = new StudyModel();
    }

    public void setExamResult(int a, int b) {
        String test_percent = String.format("%.2f", (a
                * 1.0 / b * 100.0));
    }

    public void showMenu() {
        activity.showMenu(currentMode);
    }

    public void initExam() {
        List<Object> mData;
        mData = model.loadWords();
        activity.initStudyData(mData);
    }

    public void initStudy() {
        List<Object> mData;
        mData = model.loadWords();
        activity.initStudyData(mData);

    }

    public void updatePageIndex(int i) {
        activity.updatePageIndex(i);
    }

}
